package com.panda.delivery.utils;

import android.content.Context;
import android.widget.Toast;

public class Uitls {

    public static void tshow(Context c, String message){
        Toast.makeText(c, message, Toast.LENGTH_SHORT).show();
    }


    /**
     * 根据：间转换显示格式数据(h：m：s)
     *
     * @param time
     * @return
     */
    public static String formatTime(int time) {
        String str;

        int minute = time / 60;
        int second = time % 60;
        int hour = time / 3600;

        if (hour < 10) {
            if (minute < 10) {
                if (second < 10) {
                    str = "0" + hour + "：0" + minute + "：0" + second+"";
                } else {
                    str = "0" + hour + "：0" + minute + "：" + second+"";
                }
            } else {
                if (second < 10) {
                    str = "0" + hour + "：" + minute + "：0" + second+"";
                } else {
                    str = "0" + hour + "：" + minute + "：" + second+"";
                }
            }
        } else {
            if (minute < 10) {
                if (second < 10) {
                    str = hour + "：0" + minute + "：0" + second+"";
                } else {
                    str = hour + "：0" + minute + "：" + second+"";
                }
            } else {
                if (second < 10) {
                    str = hour + "：" + minute + "：0" + second+"";
                } else {
                    str = hour + "：" + minute + "：" + second+"";
                }
            }
        }

        return str;
    }
}
